package com.chif.goingplus.service;

import com.chif.goingplus.dao.DestinationMapper;
import com.chif.goingplus.pojo.Destination;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DestinationServiceImpl implements DestinationService {

    @Autowired
    DestinationMapper destinationMapper;

    @Override
    public List<Destination> queryAllDestination() {
        return destinationMapper.queryAllDestination();
    }

    @Override
    public Destination queryDestinationById(int id) {
        return destinationMapper.queryDestinationById(id);
    }

    @Override
    public int addDestination(Destination destination) {
        destinationMapper.addDestination(destination);
        return destination.getDeid();
    }

    @Override
    public int updateDestination(Destination destination) {
        return destinationMapper.updateDestination(destination);
    }

    @Override
    public int deleteDestinationById(int id) {
        return destinationMapper.deleteDestinationById(id);
    }
}
